import { IFeidaoAiBrowserComponent } from '@dfeidao/atom-web/interfaces';

export default async function a019(fd: IFeidaoAiBrowserComponent, args: { currentTarget: HTMLElement }) {
	// 筛选框取消按钮
	const dataset = args.currentTarget.dataset;
	const id = dataset.feidaoId;		// 字段名

	// 输入框
	const input = fd.data.node.querySelector<HTMLInputElement>('[data-feidao-id=input_' + id + ']');
	if (input) {
		input.removeAttribute("disabled");
		input.value = "";
	}
	// 复选框
	const input_check = fd.data.node.querySelector<HTMLInputElement>('[data-feidao-id=check_' + id + ']');
	if (input_check) {
		input_check.checked = false;
	}
	// 日期
	const begin_input = fd.data.node.querySelector('[data-feidao-id=begin_' + id + ']') as HTMLInputElement;
	if (begin_input) {
		begin_input.removeAttribute("disabled");
		begin_input.value = "";
	}
	const end_input = fd.data.node.querySelector('[data-feidao-id=end_' + id + ']') as HTMLInputElement;
	if (end_input) {
		end_input.removeAttribute("disabled");
		end_input.value = "";
	}
	// 数值
	const min_input = fd.data.node.querySelector('[data-feidao-id=min_' + id + ']') as HTMLInputElement;
	if (min_input) {
		min_input.removeAttribute("disabled");
		min_input.value = "";
	}
	const max_input = fd.data.node.querySelector('[data-feidao-id=max_' + id + ']') as HTMLInputElement;
	if (max_input) {
		max_input.removeAttribute("disabled");
		max_input.value = "";
	}
}
